package com.example.activemq;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

@Component
public class Consumer {

    Logger logger = LoggerFactory.getLogger(Consumer.class);

    @JmsListener(destination = "myMQ")
    public void receiveQueue(String text) {
        logger.info("收到消息：{}",text);
    }
}
